package com.yunji.coupon.enums;

import lombok.Getter;

/**
 * @author : peter-zhu
 * @date : 2024/10/23 20:24
 * @description : TODO
 **/
@Getter
public enum CouponTmplStatusEnum {
    UN_START(0, "待开始"),
    RUNNING(1, "进行中"),
    OVER(2, "已结束");
    private final Integer code;
    private final String desc;

    CouponTmplStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(Integer code) {
        for (CouponTmplStatusEnum couponTmplStatusEnum : CouponTmplStatusEnum.values()) {
            if (couponTmplStatusEnum.getCode().equals(code)) {
                return couponTmplStatusEnum.getDesc();
            }
        }
        return null;
    }
}
